package com.ctsi.commons.event.config;

import java.io.Serializable;

/**
 * 模块发布的事件源
 * 
 * @author zhangjw
 * 
 */
public class EventSource implements Serializable {
	private String eventId;
	private String description;
	private String moduleId;

	
	public EventSource(){}
	
	public EventSource(String eventId){
		this.eventId=eventId;
	}
	public String getEventId() {
		return eventId;
	}

	public void setEventId(String eventId) {
		this.eventId = eventId;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getModuleId() {
		return moduleId;
	}

	public void setModuleId(String moduleId) {
		this.moduleId = moduleId;
	}

	@Override
	public String toString() {
		return description;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!(obj instanceof EventSource) || eventId == null) {
			return false;
		}
		return eventId.equals(((EventSource) obj).eventId);
	}

	@Override
	public int hashCode() {
		return eventId == null ? super.hashCode() : eventId.hashCode();
	}
}
